Skip to content

feat(gateway): support images and audio for LINE/Telegram#726

Closed
iamninihuang wants to merge 8 commits intoopenabdev:mainfrom
iamninihuang:feat/690-gateway-media-support
Closed

feat(gateway): support images and audio for LINE/Telegram#726
iamninihuang wants to merge 8 commits intoopenabdev:mainfrom
iamninihuang:feat/690-gateway-media-support

Conversation

@iamninihuang
Copy link
Copy Markdown
Contributor

@iamninihuang iamninihuang commented May 4, 2026

Summary

Added support for incoming images and audio/voice messages for LINE and Telegram adapters.

The Custom Gateway currently only supports text messages. This PR implements a Media Proxy that downloads media from platform APIs (which require auth) and serves it at a temporary local HTTP endpoint. This allows OpenAB Core and AI agents to fetch and analyze media via standard URLs, mirroring the image-understanding workflow already present in the Discord adapter.

Features

  • Inbound Media Proxy: Automatic download of images and audio from LINE/Telegram.
  • MediaStore: In-memory caching of media with configurable TTL (default 300s).
  • Schema Update: Added attachments field to GatewayEvent to propagate media URLs to the agent.
  • STT Support: Works with OpenAB's built-in speech-to-text pipeline.

Testing

Scenario Result
LINE: Send image → Gateway downloads & AI analyzes PASS
Telegram: Send image → Gateway downloads & AI analyzes PASS
LINE: Send audio/voice → Gateway downloads & STT works PASS
Telegram: Send audio/voice → Gateway downloads & STT works PASS
cargo test — 96 passed PASS
cargo clippy — 0 warnings PASS

Breaking Changes

None. Added optional attachments field to the gateway event schema. New environment variables GATEWAY_MEDIA_BASE_URL and GATEWAY_MEDIA_STORE_TTL have safe defaults.

Discord Discussion URL

https://discord.com/channels/1491295327620169908/1500160821567684660/1499859716409393172

Closes #690

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(gateway): support images and audio for LINE/Telegram

8 participants